home *** CD-ROM | disk | FTP | other *** search
- // Copyright (C) 1997-2002 Alias|Wavefront,
- // a division of Silicon Graphics Limited.
- //
- // The information in this file is provided for the exclusive use of the
- // licensees of Alias|Wavefront. Such users have the right to use, modify,
- // and incorporate this code into other products for purposes authorized
- // by the Alias|Wavefront license agreement, without fee.
- //
- // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- // PERFORMANCE OF THIS SOFTWARE.
- //
- //
- // Methods called from the trax and visor popup menus.
- //
- global proc clipApplyPoseMenuCommand(string $clip)
- {
- string $character[] = `clip -q -ch $clip`;
- if (size($character) > 0)
- {
- // apply the clip
- for ($c in $character) {
- string $poseCmd = ("pose -apply -name "+$clip+" "+$c);
- evalEcho($poseCmd);
- }
- } else {
- string $errorStr = ($clip+" is not attached to a character (use copy and paste to apply it to a character).");
- error($errorStr);
- }
- }
-
-
- global proc
- clipDuplicateMenuCommand(string $clip)
- {
- string $characters[] = `clip -q -ch $clip`;
- string $topCharacters[];
- if (size($characters) > 0)
- {
- // Schedule an duplicate of the clip at the current time
- //
- string $curTime = `currentTime -query`;
-
- if (size($characters) == 1) {
- $topCharacters[0] = $characters[0];
- } else {
- // find the top level characters, duplicating them
- // will also duplicate their subcharacters so we do not
- // need to duplicate the subcharacters on their own
- //
- int $isSubCharacter[];
- int $ii, $jj;
- int $charCount = size($characters);
- for ($ii = 0; $ii < $charCount; $ii++) {
- $isSubCharacter[$ii] = 0;
- for ($jj = 0; $jj < $charCount; $jj++) {
- if ($ii == $jj) continue;
- if (`character -isMember $characters[$jj] $characters[$ii]`)
- {
- $isSubCharacter[$ii] = 1;
- break;
- }
- }
- if (0 == $isSubCharacter[$ii]) {
- $topCharacters[size($topCharacters)] = $characters[$ii];
- }
- }
- }
-
- // duplicate the clip
- //
- for ($c in $topCharacters) {
- string $cmd = ("clip -startTime "+$curTime);
- $cmd += (" -duplicate -name "+$clip+" "+$c);
- evalEcho $cmd;
- }
- } else {
- string $errorStr = ($clip+" is not attached to a character (use copy and paste to apply it to a character).");
- error($errorStr);
- }
- }
-
-
- global proc
- clipInstanceMenuCommand(string $clip )
- {
- string $characters[] = `clip -q -ch $clip`;
- if (size($characters) > 0)
- {
- string $curTime = `currentTime -query`;
-
- // Schedule an instance of the clip.
- string $c;
- for ($c in $characters) {
- string $sch = `character -q -sc $c`;
- string $cmd = ("clipSchedule -start "+$curTime+" -in "+$clip+" "+$sch);
- evalEcho $cmd;
- }
- } else {
- string $errorStr = ($clip+" is not attached to a character (use copy and paste to apply it to a character).");
- error($errorStr);
- }
- }
-
- global proc
- clipCopyMenuCommand(string $clip)
- {
- string $cmdString = ("clip -copy "+$clip);
- evalEcho($cmdString);
- }
-